<template>
    <div class="app-container">
       <elTable ref="dataInfo" :enterSearch="true" :formData="formData" @tableData="getList">
            <el-table-column prop="spikeStartTime" label="秒杀开始时间" align="center"></el-table-column>
            <el-table-column prop="spikeEndTime" label="秒杀结束时间" align="center"></el-table-column>
            <el-table-column label="操作" align="center">
                <template slot-scope="{row,$index}">
                    <el-button type="primary" size="mini" @click="goodsMessage(row)">商品管理</el-button>
                </template>
            </el-table-column>
         </elTable>
    </div>
</template>
<script>
import apisGoodsMessage from "@/api/shopDecoration/goodsMessage"; //商品管理列表接口
import elTable from "@/components/xForm/elTable";
export default {
    name: "spikePeriod",
    components: { apisGoodsMessage,elTable },
    data() {
        return {
            formData: {
                currentPage: 1,
                pageSize: 10
            },
            dataInfo: []
        };
    },
    mounted() {
        // this.dataInfo = this.$refs.dataInfo;
    },
    methods: {
        getList(pageNo) {
            let _this = this;
            _this.formData.currentPage = pageNo || _this.formData.currentPage;
            let dataInfo = [
                {
                    id: 1,
                    spikeStartTime:'2020-7-31',
                    floorType:4
                },
            ];
            this.$nextTick(() => {
                this.$refs.dataInfo.loadData(dataInfo);
            });
            // apisGoodsMessage.spikePeriodList(this.formData).then(res=>{
            //    _this.dataInfo.loadData(res.data.list, res.data.total); 
            // })
        },
        // 秒杀商品管理
        goodsMessage(row) {
            this.$router.push({
                path: [
                     "/shopDecoration/goodsMessage",
                    row.id,
                    "商品管理:限时秒杀"
                ].join("/"),
                query: { templateId: row.id, floorType: row.floorType }
            });
        }
    }
};
</script>

<style lang="" scoped>
</style>
